package com.jbp.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jbp.model.Bank;
import com.jbp.service.BankService;
import com.jbp.utils.PageUtils;
import com.jbp.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;

/**
 * (Bank)表控制层
 * @author cc
 * @since 2021-06-28 16:50:40
 */
@Api(tags ="APP接口--Bank" )
@RestController
@RequestMapping("rest/bank")
public class BankController {
    @Autowired
    private BankService bankService;

    /** 列表 */
    @ApiOperation(value="列表")
    @ApiResponses({
            @ApiResponse(code = 200,message = "成功",response = Bank.class),
            @ApiResponse(code = 201,message = "返回失败信息")
    })
    @GetMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        QueryWrapper<Bank> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByAsc("sort");
        return R.ok( bankService.list(queryWrapper));
    }
}